////////////10:00 class/////////////////////////////// #include using namespace std; int power(int x, int y); void display(int i) { cout << i << " is an integer"; } void display(double d) { cout << d << " is a double"; } void main() { //double x; //cin >> x; //switch((int)(x/10)) //{ // //falling through // case 10: case 9: // cout << "A"; // break; // case 8: // cout << "B"; // break; // case 7: // cout << "C"; // break; // case 6: // cout << "D"; // break; // default: // cout << "F"; // break; //} //tag: //int age; //cin >> age; //if(age < 0 || age > 100) // goto tag; //naming functions //void - verb, verb-noun //non-void - noun, adjective-noun cout << power(10,4); display(4); display(4.0); } int power(int x, int y) { int result = 1; for(int i = 0; i < y;i++) { result *= x; } return result; } ///////////////11:00 classs///////////////////////// #include using namespace std; void Swap(int& x, int& y); void Swap(double& x, double& y); //int Swap(double& x, double& y); //void Swap(double& u, double& v); void main() { //double grade= 87; //cin >> grade; //switch((int)grade/10) //{ // case 10: // case 9: // cout << "A" << endl; // break; // case 8: // cout << "B" << endl; // break; // default: // cout << "F" << endl; // break; // case 7: // cout << "C" << endl; // break; // case 6: // cout << "D" << endl; // break; //} // int i = 0; // //topOfLoop: // // cout << i << endl; // i++; // if(i < 100) // { // goto topOfLoop; // } // double z = 34.345; double q = 35.2; swap(z,q); //Swap(1,2); cout << z; } void Swap(int& x, int& y) { int temp = x; x = y; y = temp; } void Swap(double& x, double& y) { double temp = x; x = y; y = temp; }